﻿@using EFEntity
@model IEnumerable<EFEntity.Esalary_grant>


@*薪酬发放登记(负责人控制) *@
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">.
        <script src="~/Scripts/vue.js"></script>
        <script src="~/Scripts/jquery-1.10.2.js"></script>
        <link href="~/lib/bootstrap/dist/css/bootstrap.css" rel="stylesheet" />
        <script type="text/javascript"
                src="../../javascript/jquery-1.7.2.js">
        </script>
        <link rel="stylesheet" href="../../css/table.css" type="text/css" />
        <script type="text/javascript" src="../../javascript/comm/comm.js"></script>
        <title>无标题文档</title>
        <STYLE type="text/css">
            td {
                text-align: center
            }
        </STYLE>
    </head>
<div id="app">
    <table width="100%">
        <tr>
            <td colspan="2" style="text-align: left">
                <font color="black">
                    您正在做的业务是：人力资源--薪酬标准管理--薪酬发放登记(负责人控制)
                </font>

            </td>
        </tr>

    </table>
    <br>
    <table width="100%" border="1" cellpadding=0 cellspacing=1
           bordercolorlight=#848284 bordercolordark=#eeeeee
           class="table table-bordered">
        <tr class="alert-info">
            <td width="10%" class="TD_STYLE1">
                <span>序号</span>
            </td>
            <td width="40%" class="TD_STYLE1">
                <span v-if="@ViewData["type"]==1">I级机构名称</span>
                <span v-if="@ViewData["type"]==2">II级机构名称</span>
                <span v-if="@ViewData["type"]==3">III级机构名称</span>
            </td>
            <td width="10%" class="TD_STYLE1">
                <span>人数</span>
            </td>
            <td width="10%" class="TD_STYLE1">
                基本薪酬总额(元)
            </td>
            <td width="10%" class="TD_STYLE1">
                登记
            </td>
        </tr>

        <tr class="TD_STYLE2">
            @foreach (var item in Model)
            {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.sgr_id)
                </td>
                <td>
                    <span v-if="@ViewData["type"]==1"> @Html.DisplayFor(modelItem => item.first_kind_name)</span>
                    <span v-if="@ViewData["type"]==2"> @Html.DisplayFor(modelItem => item.second_kind_name)</span>
                    <span v-if="@ViewData["type"]==3"> @Html.DisplayFor(modelItem => item.third_kind_name)</span>

                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.human_amount)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.salary_standard_sum)
                </td>

                <td>
                    @Html.ActionLink("登记", "register_commit", new { id = item.sgr_id,sid=item.salary_standard_id})

                </td>
            </tr>
        }
        </table>
        <p>
            &nbsp;
        </p>
        <div align="center" style="font-size: 18px;color: gray">
            &nbsp;&nbsp;总数：
            <font style="color: maroon;font-weight: bold;">@ViewBag.rows</font>
            例
            &nbsp;&nbsp;&nbsp;
            每页显示 <font style="color: maroon;font-weight: bold;">@ViewBag.pageSize</font>
            条
            &nbsp;&nbsp;&nbsp;
            当前第 <font style="color: maroon;font-weight: bold;">@ViewBag.cp</font>
            页
            &nbsp;&nbsp;&nbsp;共
            <font style="color: maroon;font-weight: bold;">@ViewBag.pages</font>
            页
            <a style="color: navy;font-weight: bold" href="/salaryGrant/register_list?currentpage=1&type=@ViewData["type"]">首页</a>
            @{ ViewData["cp"] = (int)ViewData["cp"] - 1 > 0 ? (int)ViewData["cp"] - 1 : 1;}
            <a style="color: navy;font-weight: bold"
               href="/salaryGrant/register_list?currentpage=@ViewData["cp"]&type=@ViewData["type"]">上一页</a>
            @{ ViewData["c"] = (int)ViewData["c"] + 1 < ViewBag.pages ? (int)ViewData["c"] + 1 : ViewBag.pages;}
            <a style="color: navy;font-weight: bold"
               href="/salaryGrant/register_list?currentpage=@ViewData["c"]&type=@ViewData["type"]">下一页</a>
            <a style="color: navy;font-weight: bold"
               href="/salaryGrant/register_list?currentpage=@ViewBag.pages&type=@ViewData["type"]">末页</a>

        </div>
    </div>

    <script type="text/javascript">
        var vm = new Vue({
            el: "#app",
            data: {
                list: [],
                rows: 0,
                pages: 0,
                currentpage: 1,
                pageSize: 3,
                tpage: 1
            },
            methods: {
                load: function () {
                    var t = this;
                    $.ajax({
                        url: "/salaryGrant/register_list",
                        type: "post",
                        data: "currentpage=" + t.currentpage,
                        success: function (msg) {
                            var dts = eval("(" + msg + ")");
                            t.list = dts["list"];
                            t.rows = dts["rows"];
                            t.pages = dts["pages"];
                        }
                    });
                },
                first: function () {
                    this.currentpage = 1;
                    this.load();
                },
                prev: function () {
                    if (this.currentpage > 1) {
                        this.currentpage--;
                    } else {
                        this.currentpage = 1;
                    }
                    this.load();
                },
                next: function () {

                    if (this.currentpage < this.pages) {
                        this.currentpage++;
                    } else {
                        this.currentpage = this.pages;
                    }
                    this.load();
                },
                last: function () {
                    this.currentpage = this.pages;
                    this.load();
                },
                tiao: function () {
                    var hua = $("#huahua").val();
                    var hua = this.tpage;
                    if (hua > 0 && hua <= this.pages) {
                        this.currentpage = this.tpage;
                    }
                    else if (hua == "" || hua == null) {
                        this.currentpage = 1;
                    }
                    else {
                        alert("没有该页数");
                        this.currentpage = 1;
                        this.tpage = "";
                    }
                    this.load();
                }
            },
            mounted: function () {
                this.load();
            }
        });
    </script>
